extends Control

var dialog:EvolveDialog = null
var json:Dictionary
var title = ""
var desc = ""
var is_two = false
var 唯一 = false
var cost = "2"
var 二转 = ""
var 被动 = ""
var 视野 = ""
var 动域 = ""

var texture = load("res://游戏/UI/弹窗/转型弹窗/转型item/图片/地灵.jpg")

func init(dic:Dictionary,evolveDialog:EvolveDialog):
	dialog = evolveDialog
	json = dic
	title = dic.title
	desc = dic.desc
	is_two = dic.is_two
	cost = dic.cost
	二转 = dic.二转
	被动 = dic.被动
	视野 = dic.视野
	动域 = dic.动域
	唯一 = dic.唯一
	$Control/Label.text = title
	texture = load("res://游戏/UI/弹窗/转型弹窗/转型item/图片/"+ title +".jpg")
	$Control/Sprite2D.texture = texture
	$"Control/选中框".visible = false
	self.dialog = dialog
	$AnimationPlayer.play("默认")


func _on_control_mouse_entered():
	$AnimationPlayer.play("放大")


func _on_control_mouse_exited():
	$AnimationPlayer.play("缩小")


func _on_control_gui_input(event):
	if event.is_pressed():
		if dialog != null:
			dialog.updateDetail(self)

func select():
	$"Control/选中框".visible = true

func cancelSelect():
	$"Control/选中框".visible = false
